package cn.edu.ruc.cloudcomputing.book.zookeeperTest;

import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.apache.zookeeper.KeeperException;

public class Test {
	public static void main(String[] args) throws IOException, KeeperException, InterruptedException{
		/*Date nowDate = new Date();
		Date n1Date = new Date();
		long sys = System.currentTimeMillis();
		n1Date.setTime(sys-1000*60);
		Calendar calendar = Calendar.getInstance();
		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String str = "2016-08-26 13:40:53";
		//sf.parse(str);
		System.out.println(nowDate.getTime()+"nn"+sys);
		sf.format(nowDate);
		
		System.out.println("当前时间"+sf.format(nowDate)+"jian"+sf.format(n1Date));
		System.out.println("==="+nowDate.compareTo(n1Date));
		"22".compareTo("33");
		Integer num = 3;
		Integer totalNum = 15;
		BigDecimal rate = new BigDecimal(num).divide(new BigDecimal(totalNum),4,BigDecimal.ROUND_HALF_UP);
		//System.out.println(rate);
		
		System.out.println((sys-1000*60)/1000/6000/3);*/
		Map<String,Object> map=new HashMap<String,Object>();  
        map.put("file", "12345");  
        map.put("file", "123456");
        System.out.println(map.get("file"));
        System.out.println(Math.ceil(-0.4)*8+1);
        Double weighting = new BigDecimal(6).divide(new BigDecimal(402),4,  BigDecimal.ROUND_HALF_UP).doubleValue();
        System.out.println(weighting);
	}
}
